#include <iostream>
#include <sstream>
#include <vector>

#include "common_list.h"

using namespace std;
// Definition for singly-linked list.

struct ListNode *_do_reverse(struct ListNode *a, struct ListNode *b) {
    struct ListNode *pre = nullptr, *cur = a, *nxt = a;
    while (cur != b) {
        nxt       = cur->next;
        cur->next = pre;
        pre       = cur;
        cur       = nxt;
    }
    return pre;
}
ListNode *do_reverse(struct ListNode *a, struct ListNode *b) {
    struct ListNode *newhead = do_reverse(a, b);
    a->next                  = b;
    return newhead;
}

struct ListNode *reverseKGroup(struct ListNode *head, int k) {}

int main() {
    struct ListNode *head;
    struct ListNode **p = &head;
    cout << "翻转列表(hard): "
            "https://leetcode.cn/problems/reverse-nodes-in-k-group/description/"
         << endl;

    for (int i = 0; i < 13; i++) {
        *p         = (struct ListNode *)malloc(sizeof(*head));
        (*p)->val  = i;
        (*p)->next = NULL;
        p          = &((*p)->next);
    }

    print_list(head);
    return 0;
}
